﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
namespace QLCHHoaLan
{
    public partial class FrmDangNhap : Form
    {
        public FrmDangNhap()
        {
            InitializeComponent();
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            Menu main = new Menu();
            main.Show();
            this.Close();
        }

        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            int kq = DangNhapBUS.DangNhap(txtTenDangNhap.Text,txtMatKhau.Text);
            if (kq == 1)
            {
                Menu frm = new Menu();
                frm.kq = kq;
                if (frm.kq == 1)
                {                   
                    frm.Show();
                    frm.DangNhapThanhCong();                   
                }
                this.Hide();
            }
            else
            {
                MessageBox.Show("Sai tên đăng nhập hoặc mật khẩu!", "Đăng nhập");
                return;
            }
        }

        private void lblThayDoiMatKhau_Click(object sender, EventArgs e)
        {
            FrmThayDoiMatKhau frm = new FrmThayDoiMatKhau();
            frm.Show();
            this.Hide();
        }
    }
}
